<?php
/**
 * Junction_Sql_Scalar
 * 
 * Models scalar value which may appear in a SQL query. i.e,
 * SELECT * FROM foo WHERE bar = '1', 1 is scalar.
 * 
 * @author Patrick J. Mizer <patrick.mizer@gmail.com>
 */
 
using("Junction_Sql_Writable"); 
 
class Junction_Sql_Scalar implements Junction_Sql_Writable
{
	/**
	 * Value of scalar
	 * 
	 * @var string
	 */
	private $_value;
	
	/**
	 * Junction_Sql_Scalar Constructor
	 * 
	 * @param string value
	 */
    public function __construct($value) 
    {
    	$this->_value = $value;
    }
    
    /**
	 * Implemented getSqlString from Junction_Sql_Writble
	 * interface.  This is how the scalar is represented
	 * in SQL.
     */
    public function getSqlString()
    {
    	return Junction_Sql_Utilities::addQuotes($this->_value);
    }
}
?>